package com.xuecheng.content.feign.fallback;


import com.xuecheng.common.domain.code.CommonErrorCode;
import com.xuecheng.common.domain.response.RestResponse;
import com.xuecheng.content.feign.MediaFeign;
import com.xuecheng.media.entity.MediaDTO;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class MediaFallBackFactory implements FallbackFactory<MediaFeign> {


    @Override
    public MediaFeign create(Throwable throwable) {
        return new MediaFeign() {
            @Override
            public RestResponse<MediaDTO> selectMediaId(Long mediaId) {
                return RestResponse.validfail(CommonErrorCode.E_999980);
            }
        };
    }
}
